package com.sinacom.ibuilding.beans;

import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.sinacom.ibuilding.util.Constants;
import com.sinacom.ibuilding.util.Helper;

public class News implements java.io.Serializable{

    /**
	 * 
	 */
	private static final long serialVersionUID = 6932529964719252049L;

	private String id ;
   
    private Date createDate;
    private Date modifyDate;
    private String creator;
    private String updater;
    
    private String title;
    private String content;
    private Boolean isAnnounce;
    private Boolean isShortmsg;
    private Integer type;
    private String category;
    
    private String attachs;
    private List attachList;

	private Boolean isNew;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getModifyDate() {
		return modifyDate;
	}
	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public String getUpdater() {
		return updater;
	}
	public void setUpdater(String updater) {
		this.updater = updater;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public String getBrContent() {
		if(!StringUtils.isEmpty(content)){
			return Helper.nl2br(content);
		}
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}
	public Boolean getIsAnnounce() {
		return isAnnounce;
	}
	public void setIsAnnounce(Boolean isAnnounce) {
		this.isAnnounce = isAnnounce;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	
    public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getCategoryName(){
		return Constants.getCategoryName(category);
	}
	
	public List getAttachList() {
        return attachList;
    }
    public void setAttachList(List attachList) {
        this.attachList = attachList;
    }
    
    
	   
    public Boolean getIsShortmsg() {
        return isShortmsg;
    }
    public void setIsShortmsg(Boolean isShortmsg) {
        this.isShortmsg = isShortmsg;
    }
    public String getAttachs() {
		return attachs;
	}
	public void setAttachs(String attachs) {
		this.attachs = attachs;
	}
	
	
	public Boolean getIsNew() {
		return isNew;
	}
	public void setIsNew(Boolean isNew) {
		this.isNew = isNew;
	}
	public String getCateName(){
		if(!StringUtils.isEmpty(category)){
			return Constants.getCategoryName(category);
		}
		return null;
	}

}
